﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Hope.Gallery.Models;

namespace Hope.Gallery.ViewModels
{
    public class BaseViewModel
    {
        protected Business.BL bl = null;

        #region properties

        public List<Album> Albums { get; set; }
        
        #endregion

        public BaseViewModel()
        {
            bl = new Business.BL();
        }

        #region public methods

        /// <summary>
        /// Get all albums
        /// </summary>
        public void LoadAlbums()
        {
            Albums = bl.GetAlbums()
                .Select(a => new Album
                {
                    Id = a.Id,
                    Title = a.Title,
                    Description = a.Description
                })
                .ToList();
        }

       
        
        
        
        #endregion
    }
}